public class Hilo {
	public static void main(String[] args) {

		Runnable[] tasques = new Runnable[5];
		tasques[0] = new Tarea("Modificacion", 500, 10, 1000, System.out);
		tasques[1] = new Tarea("Ja ja ja ", 0, 20, 500, System.out);
		tasques[2] = new Tarea("OOOOOOOOOOOOOO", 100, 12, 800, System.err);
		tasques[3] = new Tarea("LALALALALA", 300, 50, 20, System.out);
		tasques[4] = new Tarea("ARGH!", 100, 12, 900, System.err);

		for(int i=0;i<tasques.length;++i) {
			Thread h = new Thread(tasques[i]);
			h.start();
		}
		
		
		
//		Thread hilo1 = new Thread(new Tarea("Hola"));
//		hilo1.start();
//		Thread hilo2 = new Thread(new Tarea("Adios"));
//		hilo2.start();
////		
//		for (int i = 0; i < 10; ++i) {
//			System.out.println("["+Thread.currentThread().getId()+"] Ha pasat " + i + " segon(s)");
//			try {
//				Thread.sleep(1000);
//			} catch (InterruptedException e) {
//				System.err.println("Error: " + e.toString());
//			}
//		}
	}
}
